package org.nimi317.web_gis.Enum;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * @author thunderobot
 */

@AllArgsConstructor
public enum ProvinceDataEnum {
    //时间范围
    Hours_6(0, "6小时内数据"),
    Hours_8(1, "8小时内数据"),
    Hours_12(2, "12小时内数据"),
    Hours_24(3, "24小时内数据"),
    Month(4, "1月内数据"),
    Month_Half(5, "半月内数据");

    @JsonValue
    @EnumValue
    private final int value;
    private final String name;

    public static List<Map<String, String>> getObject() {
        List<Map<String, String>> list = new LinkedList<>();
        for (ProvinceDataEnum value : ProvinceDataEnum.values()) {
            list.add(Map.of("value", String.valueOf(value.value), "desc", value.name));
        }
        return list;
    }
}
